<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html {
            font-size: 20px;
        }

        .box1 {
            /* 
                px:CSS像素

                物理像素是再手机或者电脑生产厂商在生产这个产品的时候
                就已经规定死了，在电脑端   1px = 1个物理像素


                百分比：%
                    设置相对于父元素内容区的百分比

                em:
                    1em = 1font-size

                rem:
                    1rem = 1 html font-size
            */
            width: 50%;
            height: 200px;
            background-color: #f00;
            font-size: 20px;
        }

        .box2 {
            width: 1rem;
            height: 100px;
            background-color: green;
        }
    </style>
</head>

<body>
    <div class="box1">
        <div class="box2"></div>
    </div>
</body>

</html>